<extend name="Public/base" />

<block name="body">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title cf">
        <h2>新增 [游戏]</h2>
    </div>
    <!-- 标签页导航 -->
<div class="tab-wrap">
    <ul class="tab-nav nav">
        <li data-tab="tab1" class="current"><a href="javascript:void(0);">基础</a></li>
        <li data-tab="tab2" ><a href="javascript:void(0);">扩展</a></li>
        <li data-tab="tab3" ><a href="javascript:void(0);">设置</a></li>
    </ul>
    <div class="tab-content zc_for">
    <!-- 表单 -->
    <form id="form" action="{:U('add')}" method="post" class="form-horizontal">
        <!-- 基础 -->
        <div id="tab1" class="tab-pane in tab1 tab-look">
    		<table  border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <if condition="I('game_sible') eq ''">    
                    <span style="color: red">&nbsp;&nbsp;* 此页面为新增游戏,如添加同款游戏其他版本，请返回编辑</span>
                <else/></if>
                  <tr>
                    <td class="l">游戏名称：</td>
                    <if condition="I('game_name') eq ''">
                        <td class="r">
                            <input type="text" class="txt " name="game_name" value="" placeholder="请输入游戏名称" >
                            <input type="hidden"  name="game_appid" value="">
                        </td>
                        <td class="l">游戏支持：</td>
                        <td class="r">
                            <input type="radio" class="inp_radio js-device" value="(安卓版)" name="g_version" checked > 安卓版
                            <input type="radio" class="inp_radio js-device" value="(苹果版)" name="g_version"  > 苹果版
                        </td>
                      </tr>
                      <tr>
                        <td class="l android">第三方安卓原包地址：</td>
                        <td class="r android" >
                            <input type="text" class="txt " name="add_game_address" value="">
                        </td>
                        <td class="l ios">第三方IOS原包地址：</td>
                        <td class="r ios" >
                            <input type="text" class="txt " name="ios_game_address" value="">
                        </td>
                        <td class="l">游戏折扣：</td>
                        <td class="r">
                            <input type="text" class="txt" name="discount" value="" placeholder="游戏折扣为1-10">
                        </td>
                      </tr>
					  <tr>
                    <td class="l">游戏类型：</td>
                    <td class="r">
                        <select id="game_type_id" name="game_type_id">                            
                            <volist name=":get_game_type_all()" id="vo">
                            <option value="{$vo.id}">{$vo.type_name}</option>
                            </volist>
                        </select>
                        <input type="hidden" id="game_type_name" name="game_type_name" value=""></input>
                    </td>
                    <td class="l">开放类型：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" class="inp_radio" value="0" name="category" checked >不限                        
                            <volist name=":get_opentype_all()" id="vo">
                            <input type="radio" class="inp_radio" value="{$vo.id}" name="category" >{$vo.open_name}
                            </volist>
                        </label>
                    </td>
                </tr>
                  <tr>
                    <td class="l">分成比例：</td>
                    <td class="r">
                        <input type="text" class="txt" name="ratio" value="" placeholder="分成比例为1~100%">
                    </td>
                    <td class="l">注册单价</td>
                    <td class="r">
                        <input type="text" class="txt" name="money" value="" placeholder="注册单价(元) 大于0的整数">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏排序：</td>
                    <td class="r">
                        <input type="text" class="txt" name="sort" value="">
                    </td>

                    <td class="l">游戏版本：</td>
                    <td class="r">
                        <input type="text" class="txt" name="version" value="{$list['version']}">
                    </td>
                    <!-- <td class="l">游戏简写：</td>
                    <td class="r">
                        <input type="text" class="txt" name="short" value="">
                    </td> -->
                  </tr>
                  <tr>
                    <!-- <td class="l">游戏大小：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_size" value="">
                    </td> -->
                  </tr>
                  <tr>
                    <td class="l">游戏图标：<span class="infonotice2">(尺寸：115*115px)</span> </td>
                    <td class="r">
                        <input type="file" id="upload_picture_icon">
                        <input type="hidden" name="icon" id="cover_id_icon"/>
                        <div class="upload-img-box">
                        <notempty name="data['icon']">
                            <div class="upload-pre-item"><img src="{$data['icon']|get_cover='path'}"/></div>
                        </notempty>
                        </div>             
                    </td>
                    <td class="l">游戏标示：</td>
                    <td class="r" >
                        <input type="text" class="txt " name="marking" style="" value="">
                    </td>
                  </tr>
                  <tr>
                      <td class="l">游戏截图：<span class="infonotice2">(尺寸：210*350px)</span>   </td>
                      <td class="r" >
                          {:hook('UploadImages', array('name'=>'screenshot','value'=>''))}
                          
                      </td>
                    <td class="l">游戏封面：<span class="infonotice2">(尺寸：275*160px)</span>   </td>
                    <td class="r">
                        <input type="file" id="upload_picture_cover">
                        <input type="hidden" name="cover" id="cover_id_cover"/>
                        <div class="upload-img-box">
                        <notempty name="data['cover']">
                            <div class="upload-pre-item"><img src="{$data['cover']|get_cover='path'}"/></div>
                        </notempty>
                        </div>
                        
                    </td>


                  </tr>
                  <tr>
                    <td class="l">游戏评分：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_score" value="" placeholder="请输入小于10的一位小数">
                    </td>
                    <td class="l">游戏简介：</td>
                    <td class="r" >
                        <input type="text" class="txt " name="features" style="" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class='l'>游戏大小</td>
                    <td class='r'><input type="text" class='txt' name='game_size' value=""></td>
                    <td class="l">推荐指数：</td>
                    <td class="r">
                        <input type="text" class="txt" name="recommend_level" value="" placeholder="请输入小于10的一位小数">
                    </td>
                  </tr>
                </tbody>
            </table>
        </div>
        <!-- 扩展 -->
        <div id="tab2" class="tab-pane  tab2 tab-look">
            <table  border="0" cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td class="l">显示状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" class="inp_radio" value="0" name="game_status">关闭
                            <input type="radio" class="inp_radio" value="1" name="game_status" checked="checked">开启
                        </label>
                    </td>
                    <td class="l">推荐状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" class="inp_radio" value="0" name="recommend_status">不推荐
                            <input type="radio" class="inp_radio" value="1" name="recommend_status" checked="checked">推荐
                            <input type="radio" class="inp_radio" value="2" name="recommend_status" >热门
                            <input type="radio" class="inp_radio" value="3" name="recommend_status" >最新
                        </label>
                    </td>
                  </tr>
                  <tr>
                    <!-- <td class="l">充值状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" class="inp_radio" value="0" name="pay_status">关闭
                            <input type="radio" class="inp_radio" value="1" name="pay_status" checked="checked">开启
                        </label>
                    </td> -->
                    <td class="l">下载状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" class="inp_radio" value="0" name="dow_status">关闭
                            <input type="radio" class="inp_radio" value="1" name="dow_status" checked="checked">开启
                        </label>
                    </td>
                  </tr>
                  <tr>
                    <td class="l">语言：</td>
                    <td class="r">
                        <input type="text" class="txt" name="language" value="">
                    </td>
                    <td class="l">开发商：</td>
                    <td class="r">
                        <input type="text" class="txt" name="developers" value="">
                    </td>

                  </tr>
                  <tr>
                    <td class="l">游戏币名称：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_coin_name" value="">
                    </td>
                    <td class="l">游戏币比例：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_coin_ration" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">详细介绍：</td>
                    <td class="r" colspan='3'>
                        <textarea name="introduction" class="txt_area"></textarea>
                    </td>
                  </tr>
                </tbody>
            </table>
        </div>
        <!-- 设置 -->
        <div id="tab3" class="tab-pane  tab3 tab-look">
            <table  border="0" cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td class="l">游戏登陆通知地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="login_notify_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏支付通知地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="pay_notify_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏角色获取地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="game_role_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏礼包领取地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="game_gift_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏key：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_key" value="">
                        (游戏支付通知时的加密key)
                    </td>
                    <td class="l">访问秘钥：</td>
                    <td class="r">
                        <input type="text" class="txt" name="access_key" value="">
                        (SDK访问服务器时的加密key)
                    </td>
                  </tr>
                  <tr>
                    <td class="l">威富通商户号：</td>
                    <td class="r">
                        <input type="text" class="txt" name="partner" value="">
                        (威富通商户号)
                    </td>
                    <td class="l">威富通秘钥：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt" name="key" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏支付appid：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_pay_appid" value="">
                        (微信支付时用的的APPID)
                    </td>
                    <td class="l">游戏合作id：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt" name="agent_id" value="">

                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏包名：</td>
                    <td class="r">
                        <input type="text" class="txt" name="apk_pck_name" value="">
                        (安卓生成APK时的包名)
                    </td>
                    <td class="l">游戏签名：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt" name="apk_pck_sign" value="">
                        (安卓生成APK时的签名)
                    </td>
                  </tr>
					  
                <else/>
                        <td class="r">
                            <input type="text" class="txt " name="game_name" value="{$add_another.game_name}" readonly="readonly" >
                            <input type="hidden"  name="game_appid" value="">
                        </td>
                        <td class="l">游戏支持：</td>
                        <td class="r">
                        <input type="hidden" name='sibling_id' value='{$add_another['id']}'>
                            <input type="radio" class="inp_radio js-device" value="{$add_another['game_sible']}" name="g_version" checked > {:substr($add_another['game_sible'],1,strlen($add_another['game_sible'])-2)}
                        </td>
                      </tr>
                      <tr>
                        <td class="l android">第三方安卓原包地址：</td>
                        <td class="r android" >
                            <input type="text" class="txt " name="add_game_address" value="">
                        </td>
                        <td class="l ios">第三方IOS原包地址：</td>
                        <td class="r ios" >
                            <input type="text" class="txt " name="ios_game_address" value="">
                        </td>
                        <td class="l">游戏折扣：</td>
                        <td class="r">
                            <input type="text" class="txt" name="discount" value="" placeholder="游戏折扣为1-10">
                        </td>
                      </tr>
					  <tr>
                    <td class="l">游戏类型：</td>
                    <td class="r">
                        <select id="game_type_id" name="game_type_id"  disabled="disabled">                            
                            <volist name=":get_game_type_all()" id="vo">
                                <option value="{$vo.id}" <if condition="$list['game_type_id'] eq $vo['id']">selected="selected"</if> >{$vo.type_name}</option>
                            </volist>
                        </select>
                        <input type="hidden"  name="game_type_id" value="{$list['game_type_id']}"></input>
                        <input type="hidden" id="game_type_name" name="game_type_name" value="{$list['game_type_name']}"></input>
                    </td>
                    <td class="l">开放类型：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" class="inp_radio" value="0" name="category" checked disabled="disabled">不限                        
                            <volist name=":get_opentype_all()" id="vo">
                                <input type="radio" class="inp_radio" disabled="disabled" value="$vo['id']" name="category" <eq name="list.category"  value="$vo['id']"> checked="checked" </eq>>{$vo.open_name}
                            </volist>
                            <input type="hidden"  name="category" value="{$list['category']}"></input>
                        </label>
                    </td>
                </tr>
                  <tr>
                    <td class="l">分成比例：</td>
                    <td class="r">
                        <input type="text" class="txt" name="ratio" value="" placeholder="分成比例为1~100%">
                    </td>
                    <td class="l">注册单价</td>
                    <td class="r">
                        <input type="text" class="txt" name="money" value="" placeholder="注册单价(元) 大于0的整数">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏排序：</td>
                    <td class="r">
                        <input type="text" class="txt" name="sort" value="{$list.sort}" readonly="readonly">
                    </td>

                    <td class="l">游戏版本：</td>
                    <td class="r">
                        <input type="text" class="txt" name="version" value="">
                    </td>
                    <!-- <td class="l">游戏简写：</td>
                    <td class="r">
                        <input type="text" class="txt" name="short" value="">
                    </td> -->
                  </tr>
                  <tr>
                    <!-- <td class="l">游戏大小：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_size" value="">
                    </td> -->
                  </tr>
                  <tr>
                    <td class="l">游戏图标：<span class="infonotice2">(尺寸：115*115px)</span> </td>
                    <td class="r">
                        <input type="file" id="upload_picture_icon">
                        <input type="hidden" name="icon" id="cover_id_icon" value="{$list['icon']}" />
                        <div class="upload-img-box">
                            <notempty name="list['icon']">
                                <div class="upload-pre-item"><img src="{$list['icon']|get_cover='path'}"/></div>
                            </notempty>
                        </div>                 
                    </td>
                    <td class="l">游戏封面：<span class="infonotice2">(尺寸：275*160px)</span>   </td>
                    <td class="r">
                        <input type="file" id="upload_picture_cover">
                        <input type="hidden" name="cover" id="cover_id_cover" value="{$list['cover']}"/>
                        <div class="upload-img-box">
                        <notempty name="list['cover']">
                            <div class="upload-pre-item"><img src="{$list['cover']|get_cover='path'}"/></div>
                        </notempty>
                        </div>
                        
                    </td>
                  </tr>
                  <tr>
                      <td class="l">游戏截图：<span class="infonotice2">(尺寸：210*350px)</span>   </td>
                      <td class="r" >
                          {:hook('UploadImages', array('name'=>'screenshot','value'=>''))}
                      </td>

                    <td class="l">游戏简介：</td>
                    <td class="r" >
                        <input type="text" class="txt " name="features" value="{$list['features']}"  readonly="readonly">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏评分：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_score" value="{$list['game_score']}" placeholder="请输入小于10的一位小数" readonly="readonly">
                    </td>
                    <td class="l">推荐指数：</td>
                    <td class="r">
                        <input type="text" class="txt" name="recommend_level" value="{$list['recommend_level']}" placeholder="请输入小于10的一位小数" readonly="readonly">
                    </td>
                  </tr>
                  <tr>
                    <td class='l'>游戏大小</td>
                    <td class='r'><input type="text" class='txt' name='game_size' value=""></td>
                    <td class="l">游戏标示：</td>
                    <td class="r" >
                        <input type="text" class="txt " name="marking" value={$list['marking']}>
                    </td>
                  </tr>
                </tbody>
            </table>
        </div>
        <!-- 扩展 -->
        <div id="tab2" class="tab-pane  tab2 tab-look">
            <table  border="0" cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td class="l">显示状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" disabled="disabled" class="inp_radio" value="0" name="game_status" <if condition="$list['game_status'] eq 0">checked="checked"</if>>关闭
                            <input type="radio" disabled="disabled" class="inp_radio" value="1" name="game_status" <if condition="$list['game_status'] eq 1">checked="checked"</if>>开启
                            <input type="hidden" name="game_status" value="{$list['game_status']}">
                        </label>
                    </td>
                    <td class="l">推荐状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" disabled="disabled" class="inp_radio" value="0" name="recommend_status" <if condition="$list['recommend_status'] eq 0">checked="checked"</if>>不推荐
                            <input type="radio" disabled="disabled" class="inp_radio" value="1" name="recommend_status" <if condition="$list['recommend_status'] eq 1">checked="checked"</if>>推荐
                            <input type="radio" disabled="disabled" class="inp_radio" value="2" name="recommend_status" <if condition="$list['recommend_status'] eq 2">checked="checked"</if>>热门
                            <input type="radio" disabled="disabled" class="inp_radio" value="3" name="recommend_status" <if condition="$list['recommend_status'] eq 3">checked="checked"</if>>最新
                            <input type="hidden" name="recommend_status" value="{$list['recommend_status']}">
                        </label>
                    </td>
                  </tr>
                  <tr>
                    <!-- <td class="l">充值状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" class="inp_radio" value="0" name="pay_status">关闭
                            <input type="radio" class="inp_radio" value="1" name="pay_status" checked="checked">开启
                        </label>
                    </td> -->
                    <td class="l">下载状态：</td>
                    <td class="r">
                        <label class="inp_radio">
                            <input type="radio" disabled="disabled" class="inp_radio" value="0" name="dow_status" <if condition="$list['dow_status'] eq 0">checked="checked"</if>>关&nbsp;&nbsp;&nbsp;闭
                            <input type="radio" disabled="disabled" class="inp_radio" value="1" name="dow_status" <if condition="$list['dow_status'] eq 1">checked="checked"</if>>开启
                            <input type="hidden" name="dow_status" value="{$list['dow_status']}">
                        </label>
                    </td>
                  </tr>
                  <tr>
                    <td class="l">语言：</td>
                    <td class="r">
                        <input type="text" class="txt" name="language" value="">
                    </td>
                    <td class="l">开发商：</td>
                    <td class="r">
                        <input type="text" class="txt" name="developers" value="">
                    </td>

                  </tr>
                  <tr>
                    <td class="l">游戏币名称：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_coin_name" value="">
                    </td>
                    <td class="l">游戏币比例：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_coin_ration" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">详细介绍：</td>
                    <td class="r" colspan='3'>
                        <textarea name="introduction" class="txt_area"></textarea>
                    </td>
                  </tr>
                </tbody>
            </table>
        </div>
        <!-- 设置 -->
        <div id="tab3" class="tab-pane  tab3 tab-look">
            <table  border="0" cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td class="l">游戏登陆通知地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="login_notify_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏支付通知地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="pay_notify_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏角色获取地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="game_role_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏礼包领取地址：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt txt_title" name="game_gift_url" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏key：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_key" value="">
                        (游戏支付通知时的加密key)
                    </td>
                    <td class="l">访问秘钥：</td>
                    <td class="r">
                        <input type="text" class="txt" name="access_key" value="">
                        (SDK访问服务器时的加密key)
                    </td>
                  </tr>
                  <tr>
                    <td class="l">威富通商户号：</td>
                    <td class="r">
                        <input type="text" class="txt" name="partner" value="">
                        (威富通商户号)
                    </td>
                    <td class="l">威富通秘钥：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt" name="key" value="">
                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏支付appid：</td>
                    <td class="r">
                        <input type="text" class="txt" name="game_pay_appid" value="">
                        (微信支付时用的的APPID)
                    </td>
                    <td class="l">游戏合作id：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt" name="agent_id" value="">

                    </td>
                  </tr>
                  <tr>
                    <td class="l">游戏包名：</td>
                    <td class="r">
                        <input type="text" class="txt" name="apk_pck_name" value="">
                        (安卓生成APK时的包名)
                    </td>
                    <td class="l">游戏签名：</td>
                    <td class="r" colspan='3'>
                        <input type="text" class="txt" name="apk_pck_sign" value="">
                        (安卓生成APK时的签名)
                    </td>
                  </tr>
                    </if>
                </tr>    
               
                  
                </tbody>
            </table>
        </div>
        <div class="form-item cf">
            <button class="btn submit-btn ajax-post hidden" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <a class="btn btn-return" href="javascript:history.back(-1);">返 回</a>
        </div>
    </form>
    </div>
</div>
</block>

<block name="script">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript">
$(function() {
    var device = $('.js-device:checked');
    if (device.val()=='(苹果版)') {$('.android').addClass('hidden').find('input').attr('disabled','true');} else {$('.ios').addClass('hidden').find('input').attr('disabled','true');}
    $('.js-device').on('click',function() {
        var device = $(this);
        if (device.val()=='(苹果版)') {$('.android').addClass('hidden').siblings('.ios').removeClass('hidden').find('input').removeAttr('disabled');$('.android').find('input').attr('disabled','true');} 
        else {$('.ios').addClass('hidden').siblings('.android').removeClass('hidden').find('input').removeAttr('disabled');$('.ios').find('input').attr('disabled','true');}
    });
});
//alert($("#cover_id_icon").parent().find('.upload-img-box').html());
//导航高亮
highlight_subnav('{:U('Game/lists')}');
$('#submit').click(function(){
    $('#form').submit();
});

$(function(){
    $("input[name='game_appid']").val("{:generate_game_appid()}");
    $("#game_type_name").val($("#game_type_id option:selected").text());
    
    $('.date').datetimepicker({
        format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });
    $('.time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });
    showTab();

});

/*获取游戏类型名称*/
$("#game_type_id").change(function() {
    $("#game_type_name").val($("#game_type_id option:selected").text());
});

//上传游戏图标
/* 初始化上传插件 */
$("#upload_picture_icon").uploadify({
    "height"          : 30,
    "swf"             : "__STATIC__/uploadify/uploadify.swf",
    "fileObjName"     : "download",
    "buttonText"      : "上传图标",
    "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
    "width"           : 120,
    'removeTimeout'   : 1,
    'fileTypeExts'    : '*.jpg; *.png; *.gif;',
    "onUploadSuccess" : upload_picture_icon{$field.name},
    'onFallback' : function() {
        alert('未检测到兼容版本的Flash.');
    }
});
function upload_picture_icon{$field.name}(file, data){
    var data = $.parseJSON(data);
    var src = '';
    if(data.status){
        $("#cover_id_icon").val(data.id);
        src = data.url || '__ROOT__' + data.path;
        $("#cover_id_icon").parent().find('.upload-img-box').html(
            '<div class="upload-pre-item"><img src="' + src + '"/></div>'
        );
    } else {
        updateAlert(data.info);
        setTimeout(function(){
            $('#top-alert').find('button').click();
            $(that).removeClass('disabled').prop('disabled',false);
        },1500);
    }
}


//上传游戏封面
/* 初始化上传插件 */
$("#upload_picture_cover").uploadify({
    "height"          : 30,
    "swf"             : "__STATIC__/uploadify/uploadify.swf",
    "fileObjName"     : "download",
    "buttonText"      : "上传封面",
    "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
    "width"           : 120,
    'removeTimeout'   : 1,
    'fileTypeExts'    : '*.jpg; *.png; *.gif;',
    "onUploadSuccess" : upload_picture_cover{$field.name},
    'onFallback' : function() {
        alert('未检测到兼容版本的Flash.');
    }
});
function upload_picture_cover{$field.name}(file, data){
    var data = $.parseJSON(data);
    var src = '';
    if(data.status){
        $("#cover_id_cover").val(data.id);
        src = data.url || '__ROOT__' + data.path;
        $("#cover_id_cover").parent().find('.upload-img-box').html(
            '<div class="upload-pre-item"><img src="' + src + '"/></div>'
        );
    } else {
        updateAlert(data.info);
        setTimeout(function(){
            $('#top-alert').find('button').click();
            $(that).removeClass('disabled').prop('disabled',false);
        },1500);
    }
}
</script>
</block>
